import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { CommonModule } from '@angular/common';
import { SharedModule } from 'src/app/shared/shared.module';

// 引入第三方库的组件
import { LibrayComponent } from './page/libray.component';
import { LibListComponent } from './page/lib-list/lib-list.component';
import { LibDetailComponent } from './page/lib-detail/lib-detail.component';

// 路由配置
const routes: Routes = [
  {
    // 一级路由
    path: '', component: LibrayComponent,
    // 二级路由
    children: [
      { path: '', component: LibListComponent, data: { breadcrumb: '组件列表' } },
      { path: 'lib-list', component: LibListComponent, data: { breadcrumb: '组件列表' } },
      { path: 'lib-detail', component: LibDetailComponent, data: { breadcrumb: '组件列表' } },
    ]
  },
];

@NgModule({
  imports: [
    RouterModule.forChild(routes),
    CommonModule,
    SharedModule
  ],
  declarations: [LibrayComponent, LibDetailComponent, LibListComponent]
})
export class LibraryModule { }
